xen/arm: io: Protect the handlers with a read-write lock
authorJulien Grall <julien.grall@arm.com>
Tue, 28 Jun 2016 16:34:31 +0000 (17:34 +0100)
committerStefano Stabellini <sstabellini@kernel.org>
Mon, 11 Jul 2016 17:49:56 +0000 (18:49 +0100)
commite6c0a480eff5a650824a65cca91d3f1646a89f3b
treecc521fb97c7758d92e0ccec9081e0391dd626642
parentfdf1c6140420df20ffcdca9a0d7cdd7369fde03a
xen/arm: io: Protect the handlers with a read-write lock

Currently, accessing the I/O handlers does not require to take a lock
because new handlers are always added at the end of the array. In a
follow-up patch, this array will be sort to optimize the look up.

Given that most of the time the I/O handlers will not be modify,
using a spinlock will add contention when multiple vCPU are accessing
the emulated MMIOs. So use a read-write lock to protected the handlers.

Finally, take the opportunity to re-indent correctly domain_io_init.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
xen/arch/arm/io.c
xen/include/asm-arm/mmio.h